using Framework.Audio;
using IcecreamView;
using UnityEngine.Serialization;
using UnityEngine.UI;

namespace View.Common
{
    public class CommonAudioBtn : IC_AbstractModule
    {

        public Button[] Buttons;
        public string AudioName;

        public override void OnInitView()
        {
            if (this.Buttons.Length == 0)
                return;
            foreach (var button in this.Buttons)
                button?.onClick.AddListener(() => { AudioManager.Instance.PlaySound(this.AudioName);});
        }

    }
}